<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>数据查询</title>
<link href="<%=path%>/static/usercss/css/all.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<%=path%>/static/js/jquery-3.2.1.js"></script>
<!--[if IE]>
<script>
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()
</script>
<![endif]-->
</head>
<body>
<jsp:include page="/WEB-INF/web/includ/header.jsp"></jsp:include>
<section>
<div class="wrap">
<div class="section">
    <article id="datalist">
      
      <div id="title">
      <h1>我的添加历史列表</h1>
     
    </div>
    <datalist>
      <table border="0" cellpadding="0">
        <tr>
          <th>历史记录</th>
         
          <th>添加时间</th>
          <!-- <th>再利用量</th> -->
          <th>状态/操作</th>
        </tr>
        <c:forEach items="${requestScope.userHistory.list}" var="ht">
       
        <tr>
          <td style="text-align:left;"><a href="#">${ht.content}</a>
           <td><fmt:formatDate pattern="yyyy-MM-dd"  value="${ht.inputTime}" /></td>
          <td><c:if test="${ht.status==1 }"><span>采用</span></c:if><c:if test="${ht.status==-1 }"><span>未采用</span></c:if><c:if test="${ht.status==0 }"><span>待审核</span>&nbsp;<a style="font-style: italic;color:blue;text-decoration:underline;text-decoration-color:blue;" href="<%=path %>/web/rubbish/delObject2?type=${ht.type}&objectId=${ht.objectId}">删除</a></c:if>
        </tr>
       
       </c:forEach>
        
         
      </table>
    </datalist>
    <div class="pagination ">
     <a id="first" href="<%=path %>/web/rubbish/showHistory?pageNum=1">首页</a>
    
    <c:forEach items="${requestScope.userHistory.navigatepageNums }" var="page">
    	<a id="page${page }" href="<%=path %>/web/rubbish/showHistory?pageNum=${page}" class="number">${page}</a>
    </c:forEach>
   
    <a id="last" href="<%=path %>/web/article/list?pageNum=${requestScope.userHistory.pages}">尾页</a>
    <span>共${requestScope.userHistory.pages}页</span>
    </div>
    </article>
  <jsp:include page="/WEB-INF/web/includ/aside.jsp"></jsp:include>
</div>
</div>
</section>
<script type="text/javascript" src="<%=path%>/static/managecss/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="<%=path%>/static/js/jquery-3.2.1.js"></script>
<script src="<%=path%>/static/managecss/lib/layer/2.4/layer.js"></script>
<script type="text/javascript">
	$(function() {
			
			if("${param.pageNum}"==""||"${param.pageNum}"<1){
				$("a[title=第1页]").attr("class","number current");
				
			}
			if("${param.pageNum}">"${requestScope.dataList.pages}"){
				$("a[title=第${requestScope.dataList.pages}页]").attr("class","number current");
				
			}
	})


	function delectOne(obj,id) {
		layer.confirm('确认要删除吗？',{
			  btn: ['确定', '取消'] //可以无限个按钮
		  ,
		}, function(index, layero){	
			
			$.ajax({
				type:'post',
				url:'<%=path%>/web/userinfo/dataDelect',
				data:{id:id},
				success:function(mes){					
					$(obj).parents("tr").remove();
					layer.close(index);
				}
			}); 
			
		}, function(index){
			  
			
		});
	 	
		
		
	}

	$(function() {
		$("a[id=change]").click(function() {
			  var id = $(this).prev().val();
				location.href="<%=path%>/web/userinfo/changeData?id="+id;
		});
	});


</script>

<jsp:include page="/WEB-INF/web/includ/footer.jsp"></jsp:include>
</body>
</html>
